Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remove and exist with _id type different of ObjectId #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joarley
Copy link

@joarley joarley commented Dec 26, 2015

No description provided.

@Reggino
Copy link
Collaborator

Reggino commented Dec 28, 2015

Thanks for this. Could you please add a test to prevent regression errors in the future? Thanks

@joarley
Copy link
Author

joarley commented Jan 5, 2016

yes, I will do.

if (options._id) {
_id = this.tryParseObjectId(options._id) || options._id;
options._id = this.tryParseObjectId(options._id) || options._id;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are now mutating the options object passed in, this is considered a bad practice and can lead to some hard to track down bugs...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, you're right. I fixed the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants